// ****************************************************************************** 
// Copyright     :  Copyright (C) 2018, Hisilicon Technologies Co. Ltd.
// File name     :  scd_c_union_define.h
// Project line  :  K3
// Department    :  K3
// Author        :  Huawei
// Version       :  V100
// Date          :  2015/4/10
// Description   :  HiVcodecV100 VDEC
// Others        :  Generated automatically by nManager V4.2 
// History       :  Huawei 2018/04/10 10:02:39 Create file
// ******************************************************************************

#ifndef __SCD_C_UNION_DEFINE_H__
#define __SCD_C_UNION_DEFINE_H__

/* Define the union U_SCD_START */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_0         : 31  ; /* [31:1] */
        unsigned int    scd_top_start : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_START;

/* Define the union U_LIST_ADDRESS */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    list_base_addr : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_LIST_ADDRESS;

/* Define the union U_UP_ADDRESS */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    up_base_address : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_UP_ADDRESS;

/* Define the union U_UP_LEN */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    up_length : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_UP_LEN;

/* Define the union U_BUFFER_FIRST */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    buffer_first_addr : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_BUFFER_FIRST;

/* Define the union U_BUFFER_LAST */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    buffer_last_addr : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_BUFFER_LAST;

/* Define the union U_BUFFER_INI */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    buffer_ini_addr : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_BUFFER_INI;

/* Define the union U_SCD_INT_MASK */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    scd_reserve   : 31  ; /* [31:1] */
        unsigned int    scd_intr_mask : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_INT_MASK;

/* Define the union U_SCD_PROTOCOL */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_1            : 16  ; /* [31:16] */
        unsigned int    scd_bypass_flag  : 1  ; /* [15] */
        unsigned int    cfg_metadata_en  : 1  ; /* [14] */
        unsigned int    rdbuf_mmu_en     : 1  ; /* [13] */
        unsigned int    scd_ema          : 3  ; /* [12:10] */
        unsigned int    other_mmu_en     : 1  ; /* [9] */
        unsigned int    scd_lowdly_en    : 1  ; /* [8] */
        unsigned int    scd_safe_mode    : 1  ; /* [7] */
        unsigned int    pes_check_flag   : 1  ; /* [6] */
        unsigned int    mpeg4_fpga_flag  : 1  ; /* [5] */
        unsigned int    slice_check_flag : 1  ; /* [4] */
        unsigned int    scd_protocol     : 4  ; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_PROTOCOL;

/* Define the union U_SCD_NORM_INI_CLR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    scd_int_flag : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_NORM_INI_CLR;

/* Define the union U_SCD_PREVIOUS_LSB */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    scd_previous_byte_lsb : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_PREVIOUS_LSB;

/* Define the union U_SCD_INT_FLAG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_2        : 30  ; /* [31:2] */
        unsigned int    scd_rst_busy : 1  ; /* [1] */
        unsigned int    scd_int_flag : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_INT_FLAG;

/* Define the union U_SCD_PREVIOUS_MSB */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_3                 : 16  ; /* [31:16] */
        unsigned int    scd_previous_byte_msb : 16  ; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_PREVIOUS_MSB;

/* Define the union U_SCD_BYTE_VALID */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_4           : 26  ; /* [31:6] */
        unsigned int    scd_bytes_valid : 6  ; /* [5:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_BYTE_VALID;

/* Define the union U_SCD_NUMBER */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    short_header_num : 10  ; /* [31:22] */
        unsigned int    scd_num_out      : 22  ; /* [21:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_NUMBER;

/* Define the union U_RLL_ADDR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    roll_addr : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RLL_ADDR;

/* Define the union U_SCR_RAT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_5           : 1  ; /* [31] */
        unsigned int    scr_eaten[30:0] : 31  ; /* [30:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCR_RAT;

/* Define the union U_SCR_OFFSET */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    seg_buffer_offset : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCR_OFFSET;

/* Define the union U_SCR_NXT_ADDR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    seg_next_addr : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCR_NXT_ADDR;

/* Define the union U_STA */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_6        : 8  ; /* [31:24] */
        unsigned int    cur_sta_wdat : 4  ; /* [23:20] */
        unsigned int    cur_sta_rdat : 4  ; /* [19:16] */
        unsigned int    rsv_7        : 4  ; /* [15:12] */
        unsigned int    cur_sta_det  : 4  ; /* [11:8] */
        unsigned int    rsv_8        : 1  ; /* [7] */
        unsigned int    cur_sta_main : 7  ; /* [6:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_STA;

/* Define the union U_SDWR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_9           : 19  ; /* [31:13] */
        unsigned int    sdwr_num_burst  : 5  ; /* [12:8] */
        unsigned int    sdwr_cnt_burst  : 4  ; /* [7:4] */
        unsigned int    rsv_10          : 1  ; /* [3] */
        unsigned int    sdwr_curr_state : 3  ; /* [2:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SDWR;

/* Define the union U_RUN_CYCLE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    scd_run_cycle : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_RUN_CYCLE;

/* Define the union U_SCD_RD_REQ */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rd_req_num : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_RD_REQ;

/* Define the union U_SCD_RD_DAT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rd_dat_num : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_RD_DAT;

/* Define the union U_SCD_WR_REQ */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wr_req_num : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_WR_REQ;

/* Define the union U_SCD_WR_DAT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wr_dat_num : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_WR_DAT;

/* Define the union U_SCD_WORK_ST */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    cur_scd_st : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_WORK_ST;

/* Define the union U_SCD_CLK_CFG */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_11       : 30  ; /* [31:2] */
        unsigned int    clk_cfg[1:0] : 2  ; /* [1:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_CLK_CFG;

/* Define the union U_SCD_ARBIT_DG0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    scd_arbit_dg0 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_ARBIT_DG0;

/* Define the union U_SCD_ARBIT_DG1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    scd_arbit_dg1 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_ARBIT_DG1;

/* Define the union U_SCD_ARBIT_DG2 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rcmd_c2a_fifo_dg : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_ARBIT_DG2;

/* Define the union U_SCD_ARBIT_DG3 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    wcmd_c2a_fifo_dg : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_ARBIT_DG3;

/* Define the union U_SCD_SOFTRST_DG0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    softrst_state0 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_SOFTRST_DG0;

/* Define the union U_SCD_SOFTRST_DG1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    softrst_state1 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_SOFTRST_DG1;

/* Define the union U_SCD_SAFE_INT_MASK */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_12             : 31  ; /* [31:1] */
        unsigned int    scd_safe_intr_mask : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_SAFE_INT_MASK;

/* Define the union U_SCD_SAFE_INI_CLR */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_13            : 31  ; /* [31:1] */
        unsigned int    scd_safe_int_flag : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_SCD_SAFE_INI_CLR;


//==============================================================================
/* Define the global struct */
typedef struct
{
    volatile U_SCD_START         SCD_START         ; /* 0 */
    volatile U_LIST_ADDRESS      LIST_ADDRESS      ; /* 4 */
    volatile U_UP_ADDRESS        UP_ADDRESS        ; /* 8 */
    volatile U_UP_LEN            UP_LEN            ; /* C */
    volatile U_BUFFER_FIRST      BUFFER_FIRST      ; /* 10 */
    volatile U_BUFFER_LAST       BUFFER_LAST       ; /* 14 */
    volatile U_BUFFER_INI        BUFFER_INI        ; /* 18 */
    volatile U_SCD_INT_MASK      SCD_INT_MASK      ; /* 1C */
    volatile U_SCD_PROTOCOL      SCD_PROTOCOL      ; /* 20 */
    volatile U_SCD_NORM_INI_CLR  SCD_NORM_INI_CLR  ; /* 24 */
    volatile U_SCD_PREVIOUS_LSB  SCD_PREVIOUS_LSB  ; /* 3C */
    volatile U_SCD_INT_FLAG      SCD_INT_FLAG      ; /* 40 */
    volatile U_SCD_PREVIOUS_MSB  SCD_PREVIOUS_MSB  ; /* 44 */
    volatile U_SCD_BYTE_VALID    SCD_BYTE_VALID    ; /* 48 */
    volatile U_SCD_NUMBER        SCD_NUMBER        ; /* 4C */
    volatile U_RLL_ADDR          RLL_ADDR          ; /* 50 */
    volatile U_SCR_RAT           SCR_RAT           ; /* 54 */
    volatile U_SCR_OFFSET        SCR_OFFSET        ; /* 58 */
    volatile U_SCR_NXT_ADDR      SCR_NXT_ADDR      ; /* 5C */
    volatile U_STA               STA               ; /* 60 */
    volatile U_SDWR              SDWR              ; /* 64 */
    volatile U_RUN_CYCLE         RUN_CYCLE         ; /* 68 */
    volatile U_SCD_RD_REQ        SCD_RD_REQ        ; /* 6C */
    volatile U_SCD_RD_DAT        SCD_RD_DAT        ; /* 70 */
    volatile U_SCD_WR_REQ        SCD_WR_REQ        ; /* 74 */
    volatile U_SCD_WR_DAT        SCD_WR_DAT        ; /* 78 */
    volatile U_SCD_WORK_ST       SCD_WORK_ST       ; /* 7C */
    volatile U_SCD_CLK_CFG       SCD_CLK_CFG       ; /* 80 */
    volatile U_SCD_ARBIT_DG0     SCD_ARBIT_DG0     ; /* 84 */
    volatile U_SCD_ARBIT_DG1     SCD_ARBIT_DG1     ; /* 88 */
    volatile U_SCD_ARBIT_DG2     SCD_ARBIT_DG2     ; /* 8C */
    volatile U_SCD_ARBIT_DG3     SCD_ARBIT_DG3     ; /* 90 */
    volatile U_SCD_SOFTRST_DG0   SCD_SOFTRST_DG0   ; /* 94 */
    volatile U_SCD_SOFTRST_DG1   SCD_SOFTRST_DG1   ; /* 98 */
    volatile U_SCD_SAFE_INT_MASK SCD_SAFE_INT_MASK ; /* C4 */
    volatile U_SCD_SAFE_INI_CLR  SCD_SAFE_INI_CLR  ; /* C8 */

} S_scd_REGS_TYPE;

/* Declare the struct pointor of the module scd */
extern volatile S_scd_REGS_TYPE *gopscdAllReg;

/* Declare the functions that set the member value */
int iSetSCD_START_scd_top_start(unsigned int uscd_top_start);
int iSetLIST_ADDRESS_list_base_addr(unsigned int ulist_base_addr);
int iSetUP_ADDRESS_up_base_address(unsigned int uup_base_address);
int iSetUP_LEN_up_length(unsigned int uup_length);
int iSetBUFFER_FIRST_buffer_first_addr(unsigned int ubuffer_first_addr);
int iSetBUFFER_LAST_buffer_last_addr(unsigned int ubuffer_last_addr);
int iSetBUFFER_INI_buffer_ini_addr(unsigned int ubuffer_ini_addr);
int iSetSCD_INT_MASK_scd_reserve(unsigned int uscd_reserve);
int iSetSCD_INT_MASK_scd_intr_mask(unsigned int uscd_intr_mask);
int iSetSCD_PROTOCOL_scd_bypass_flag(unsigned int uscd_bypass_flag);
int iSetSCD_PROTOCOL_cfg_metadata_en(unsigned int ucfg_metadata_en);
int iSetSCD_PROTOCOL_rdbuf_mmu_en(unsigned int urdbuf_mmu_en);
int iSetSCD_PROTOCOL_scd_ema(unsigned int uscd_ema);
int iSetSCD_PROTOCOL_other_mmu_en(unsigned int uother_mmu_en);
int iSetSCD_PROTOCOL_scd_lowdly_en(unsigned int uscd_lowdly_en);
int iSetSCD_PROTOCOL_scd_safe_mode(unsigned int uscd_safe_mode);
int iSetSCD_PROTOCOL_pes_check_flag(unsigned int upes_check_flag);
int iSetSCD_PROTOCOL_mpeg4_fpga_flag(unsigned int umpeg4_fpga_flag);
int iSetSCD_PROTOCOL_slice_check_flag(unsigned int uslice_check_flag);
int iSetSCD_PROTOCOL_scd_protocol(unsigned int uscd_protocol);
int iSetSCD_NORM_INI_CLR_scd_int_flag(unsigned int uscd_int_flag);
int iSetSCD_PREVIOUS_LSB_scd_previous_byte_lsb(unsigned int uscd_previous_byte_lsb);
int iSetSCD_INT_FLAG_scd_rst_busy(unsigned int uscd_rst_busy);
int iSetSCD_INT_FLAG_scd_int_flag(unsigned int uscd_int_flag);
int iSetSCD_PREVIOUS_MSB_scd_previous_byte_msb(unsigned int uscd_previous_byte_msb);
int iSetSCD_BYTE_VALID_scd_bytes_valid(unsigned int uscd_bytes_valid);
int iSetSCD_NUMBER_short_header_num(unsigned int ushort_header_num);
int iSetSCD_NUMBER_scd_num_out(unsigned int uscd_num_out);
int iSetRLL_ADDR_roll_addr(unsigned int uroll_addr);
int iSetSCR_RAT_scr_eaten[30:0](unsigned int uscr_eaten[30:0]);
int iSetSCR_OFFSET_seg_buffer_offset(unsigned int useg_buffer_offset);
int iSetSCR_NXT_ADDR_seg_next_addr(unsigned int useg_next_addr);
int iSetSTA_cur_sta_wdat(unsigned int ucur_sta_wdat);
int iSetSTA_cur_sta_rdat(unsigned int ucur_sta_rdat);
int iSetSTA_cur_sta_det(unsigned int ucur_sta_det);
int iSetSTA_cur_sta_main(unsigned int ucur_sta_main);
int iSetSDWR_sdwr_num_burst(unsigned int usdwr_num_burst);
int iSetSDWR_sdwr_cnt_burst(unsigned int usdwr_cnt_burst);
int iSetSDWR_sdwr_curr_state(unsigned int usdwr_curr_state);
int iSetRUN_CYCLE_scd_run_cycle(unsigned int uscd_run_cycle);
int iSetSCD_RD_REQ_rd_req_num(unsigned int urd_req_num);
int iSetSCD_RD_DAT_rd_dat_num(unsigned int urd_dat_num);
int iSetSCD_WR_REQ_wr_req_num(unsigned int uwr_req_num);
int iSetSCD_WR_DAT_wr_dat_num(unsigned int uwr_dat_num);
int iSetSCD_WORK_ST_cur_scd_st(unsigned int ucur_scd_st);
int iSetSCD_CLK_CFG_clk_cfg[1:0](unsigned int uclk_cfg[1:0]);
int iSetSCD_ARBIT_DG0_scd_arbit_dg0(unsigned int uscd_arbit_dg0);
int iSetSCD_ARBIT_DG1_scd_arbit_dg1(unsigned int uscd_arbit_dg1);
int iSetSCD_ARBIT_DG2_rcmd_c2a_fifo_dg(unsigned int urcmd_c2a_fifo_dg);
int iSetSCD_ARBIT_DG3_wcmd_c2a_fifo_dg(unsigned int uwcmd_c2a_fifo_dg);
int iSetSCD_SOFTRST_DG0_softrst_state0(unsigned int usoftrst_state0);
int iSetSCD_SOFTRST_DG1_softrst_state1(unsigned int usoftrst_state1);
int iSetSCD_SAFE_INT_MASK_scd_safe_intr_mask(unsigned int uscd_safe_intr_mask);
int iSetSCD_SAFE_INI_CLR_scd_safe_int_flag(unsigned int uscd_safe_int_flag);

#endif // __SCD_C_UNION_DEFINE_H__
